﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for CategoryBL
/// </summary>
public class CategoryBL : CategoryProperties
{
   	public CategoryBL()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public CategoryBL(string categoryName, string parentCategory, long userId)
    {
        // TODO: Complete member initialization
        this.CategoryName = categoryName;
        this.ParentCategoryId = Convert.ToInt64(parentCategory);
        this.UserId = userId;
    }

    public CategoryBL(long categoryId, string categoryName, string parentCategory, long userId)
    {
        // TODO: Complete member initialization
        this.CategoryId = categoryId;
        this.CategoryName = categoryName;
        this.ParentCategoryId = Convert.ToInt64(parentCategory); 
        this.UserId = userId;
    }

    public CategoryBL(long categoryId)
    {
        // TODO: Complete member initialization
        this.CategoryId = categoryId;
    }

    public object GetMainCategories()
    {
        return CategoryDL.GetMainCategories();
    }

    public object GetSubCategories(string categoryId)
    {
        return CategoryDL.GetSubCategories(categoryId);
    }

    public bool Insert()
    {
        return CategoryDL.Insert(this);
    }

    public bool Update()
    {
        return CategoryDL.Update(this);
    }

    public bool Delete()
    {
        return CategoryDL.Delete(this);
    }
}